#include <gnuplotter.h>

void usage ( char * this, options_t * options ) {
	fprintf(stderr,"usage: %s [-t plottype] [-w window_x window_y] [-d grid_x grid_y] [-s grid_sigma] [-o output]\n", this);
	fprintf(stderr,"  -t plottype = { pm3d, points, dots, lines }\n");
	fprintf(stderr,"  -w geometry plottype = { pm4d, points, dots, lines, heat }\n");
	fprintf(stderr,"  -w window_x/window_y = graph window/output size\n");
	fprintf(stderr,"  -d grid_x/grid_y = dimension of output grid for grid-type graphs\n");
	fprintf(stderr,"  -s grid_sigma = width of gaussians used for kernel interpolation\n");
	fprintf(stderr,"  -o output = graph output file (runs non-interactively if specified)\n");

	exit(-1);
}

void cleanup ( options_t * options ) {

	if (options->readarray) free(options->readarray);

	if (options->cmdfile) {
		fclose(options->cmdfile);
		remove(options->cmdname);
	}
	if (options->tempfile) {
		fclose(options->tempfile);
		remove(options->tempname);
	}

	if (options->outfile) fclose(options->outfile);

	exit(0);
}
